#include "ALLMenu.h"
#include "Show.h"
#include "data.h"

SetVolumeMenu::SetVolumeMenu(IMenu *FM) {
	FatherMenu = FM;
	Name.push_back("Back");
	Name.push_back("Set Volume");
	NextMenu = FatherMenu;
}

SetVolumeMenu::~SetVolumeMenu() {

}

bool SetVolumeMenu::process() {
	int opt = -1;
	Show show(this);
	Choose chs;
	while(opt == -1) {
		show.Display();
		opt = chs.Option(this);
	}
	if(opt != 0) {
		opt = -1;
		while(opt == -1) {
			show.SetVolume();
			Choose chs;
			opt = chs.SetVolume();
		}
		Data::getInstance().setVolume(opt);
	}
	MenuMgr::getInstance().SetActiveMenu(FatherMenu);
	return !OVER;
}

std::string SetVolumeMenu::GetChildName(int k) {
	return Name[k];
}

int SetVolumeMenu::GetItem() {
	return item;
}

std::string SetVolumeMenu::GetMyName() {
	return Myname;
}

